import request from '@/utils/request'

// 查询会员卡管理列表
export function listCard(query) {
  return request({
    url: '/member/card/list',
    method: 'get',
    params: query
  })
}
// 查询会员卡管理列表
export function listInfo(query) {
  return request({
    url: '/member/card/bindable/memberinfo/list',
    method: 'get',
    params: query
  })
}

// 查询会员卡金额变动
export function getCardDetails(cardId) {
  return request({
    url: '/member/cardDetails/' + cardId,
    method: 'get'
  })
}

// 查询会员卡操作记录
export function getCardOperates(data) {
  return request({
    url: '/member/operates/list',
    method: 'get',
    params: data
  })
}

// 查询会员卡管理详细
export function getCard(cardId) {
  return request({
    url: '/member/card/' + cardId,
    method: 'get'
  })
}

// 新增会员卡管理
export function addCard(data) {
  return request({
    url: '/member/card',
    method: 'post',
    data: data
  })
}

// 修改会员卡管理
export function updateCard(data) {
  return request({
    url: '/member/card',
    method: 'put',
    data: data
  })
}

// 删除会员卡管理
export function delCard(cardId) {
  return request({
    url: '/member/card/' + cardId,
    method: 'delete'
  })
}

// 绑卡
export function bindCard(data) {
  return request({
    url: 'member/card/bind',
    method: 'put',
    data: data
  })
}

// 挂失
export function lossCard(data) {
  return request({
    url: 'member/card/loss',
    method: 'put',
    data: data
  })
}

// 取消挂失
export function cancelLossCard(data) {
  return request({
    url: 'member/card/cancelLoss',
    method: 'put',
    data: data
  })
}

// 注销
export function cancelCard(data) {
  return request({
    url: 'member/card/cancelCard',
    method: 'put',
    data: data
  })
}

// 退卡
export function checkOutCard(data) {
  return request({
    url: 'member/card/checkOutCard',
    method: 'put',
    data: data
  })
}

// 导出会员卡管理
export function exportCard(query) {
  return request({
    url: '/member/card/export',
    method: 'get',
    params: query
  })
}
